package com.darly.widget.charting.highlight;

/**
 * Created by Philipp Jahoda on 24/07/15. Class that represents the range of one value in a stacked bar entry. e.g.
 * stack values are -10, 5, 20 -> then ranges are (-10 - 0, 0 - 5, 5 - 25).
 */
public final class Range {

    public float from;
    public float to;

    public Range(float from, float to) {
        this.from = from;
        this.to = to;
    }

    /**
     * Returns true if this range contains (if the value is in between) the given value, false if not.
     *
     * @param value
     * @return
     */
    public boolean contains(float value) {

        if (value > from && value <= to)
            return true;
        else
            return false;
    }

    public boolean isLarger(float value) {
        return value > to;
    }

    public boolean isSmaller(float value) {
        return value < from;
    }
}